class Book {
  int? id;
  final String title;
  final String author;

  Book({this.id, required this.title, required this.author});


  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'title': title,
      'author': author,
    };
  }

  factory Book.fromMap(Map<String, dynamic> map) {
    return Book(
      id: map['id'],
      title: map['title'],
      author: map['author'],
    );
  }

  @override
  String toString() => 'Book(id:$id, title:$title, author:$author)';
}

